<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>患者详情信息</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <style>
        .patient-list-fix-bottom {
            width: 96%;
            margin: 1rem auto 0.5rem;
            border: 1px solid #ddd;
            border-radius: 0.6rem;
            box-shadow: 0 0 8px rgba(87, 160, 243, 0.8);
            padding: 0.5rem;
            background: #fff;
            height: 6rem;
        }

        .aui-active {
            background-color: rgb(113, 190, 241);
            color: #fff !important;
        }

        .aui-list-item-inner {
            color: #333;
            font-size: 0.7rem;
        }

        .aui-list-item-inner>span:first-child {
            font-weight: 700;
        }
    </style>
</head>

<body>
    <main id="app" style="background: #fff">
        <section class="patient-list-fix-bottom" id="EssentialInformation" @touchmove.prevent.stop>
            <div class="aui-row aui-row-padded">
                <div class="aui-col-xs-6">
                    <div class="aui-list-item-inner">
                        <span>住院号：</span>
                        <span id="trPatientNo"></span>
                    </div>
                </div>
                <div class="aui-col-xs-6">
                    <div class="aui-list-item-inner">
                        <span>姓名：</span>
                        <span id="aiName"></span>
                    </div>
                </div>
                <div class="aui-col-xs-6">
                    <div class="aui-list-item-inner">
                        <span>手机号码：</span>
                        <span id="aiPhone"></span>
                    </div>
                </div>
                <div class="aui-col-xs-6">
                    <div class="aui-list-item-inner">
                        <span>性别：</span>
                        <span id="aiGender"></span>
                    </div>
                </div>
                <div class="aui-col-xs-6">
                    <div class="aui-list-item-inner">
                        <span>出生日期：</span>
                        <span id="aiBirthTime"></span>
                    </div>
                </div>
                <div class="aui-col-xs-6">
                    <div class="aui-list-item-inner">
                        <span>患者诊断：</span>
                        <span id="trDiagnosis"></span>
                    </div>
                </div>
            </div>
        </section>
        <!-- <div style="height: 5px;width:100%;margin-bottom:0.5rem;background:pink"></div> -->
        <div class="aui-tab" id="tab">
            <div class="aui-tab-item aui-active" id="a">
                评估书
            </div>
            <div class="aui-tab-item" id="b">
                治疗记录单
            </div>
            <div class="aui-tab-item" id="c">
                医嘱
            </div>
            <!-- <div class="aui-tab-item" id="d">
                电子病历
            </div> -->
            <div class="aui-tab-item" id="e">
                同意书
            </div>

            <!-- <div class="aui-tab-item" id="f">
                病程记录
            </div> -->
            <div class="aui-tab-item" id="g">
                生命体征记录
            </div>
            <div class="aui-tab-item" id="h">
                并发症
            </div>
            <div class="aui-tab-item" id="i">
                陪护
            </div>
        </div>
    </main>
</body>
<script src="../script/api.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/vue.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/jquery.min.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/ToConfigure.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-toast.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-dialog.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-tab.js" charset="utf-8" type="text/javascript"></script>

<script type="text/javascript">
    apiready = function () {
        //接收患者ID
        var trId = api.pageParam.F_ID;
        //定义toast提示框
        var toast = new auiToast();
        PatientInformation();
        //患者基本信息
        function PatientInformation() {

            //获取所属医院IP地址
            var Url_IP = ToConfigure_IP("Gorgeous");
            //查询患者基本信息
            var Query_JsParms = new Object();
            //获取患者预约ID
            Query_JsParms.trId = trId;
            if (Query_JsParms.trId !== '' || Query_JsParms.trId !== undefined) {
                //转换为json数据
                var JsonStr = JSON.stringify(Query_JsParms);
                /**
                     * 请求控制器
                     */
                $.ajax({
                    url: Url_IP + '/businessmanagement/hotreatmentregister/getHoTreatmentRegister',
                    type: 'post',
                    async: false,
                    contentType: "application/json",
                    dataType: "json",
                    data: JsonStr,
                    success: function (result) {
                        /**
                         * 验证返回信息是否为空
                         */
                        if (result.success == true) {
                            $.each(result.data.list, function (i, o) {
                                document.getElementById("trPatientNo").innerHTML = o.trPatientNo
                                document.getElementById("aiName").innerHTML = o.hoArchivalInformationEntity.aiName
                                document.getElementById("aiPhone").innerHTML = o.hoArchivalInformationEntity.aiPhone
                                document.getElementById("aiGender").innerHTML = o.hoArchivalInformationEntity.aiGender
                                document.getElementById("aiBirthTime").innerHTML = o.hoArchivalInformationEntity.aiBirthTime
                                document.getElementById("trDiagnosis").innerHTML = o.trDiagnosis
                                toast.success({
                                    title: "加载成功",
                                    duration: 2000
                                });
                            })
                            api.hideProgress();
                        } else {
                            toast.fail({
                                title: "加载失败",
                                duration: 2000
                            });
                        }
                    },
                    error: function (result) {
                        toast.fail({
                            title: "加载失败",
                            duration: 2000
                        });
                    }
                });
            }

        }
        //tab页操作
        header = $api.offset($api.byId('EssentialInformation')).h + 10;
        api.openFrameGroup({
            name: 'siji',
            scrollEnabled: false,
            rect: {
                x: 0,
                y: 350,
                w: 'auto',
                h: 'auto'
            },
            frames: [{
                name: 'Patient_Assessment',
                url: 'Patient_Assessment.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: trId
                }
            }, {
                name: 'Patient_TreatmentRecord',
                url: 'Patient_TreatmentRecord.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: trId
                }
            }, {
                name: 'Patient_DoctorsAdvice',
                url: 'Patient_DoctorsAdvice.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: trId
                }
            }, {
                name: 'Patient_InformedConsent',
                url: 'Patient_InformedConsent.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: trId
                }
            }, {
                name: 'Patient_Vital_Signs',
                url: 'Patient_Vital_Signs.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: trId,
                    userName: api.pageParam["userName"]
                }
            },
            // }, {
            //     name: 'complicationsinfor_hender',
            //     url: 'complicationsinfor_hender.html',
            //     bgColor: '#fff',
            //     pageParam: {
            //         F_ID: trId
            //     }
            // },{
            //     name: 'Patient_MedicalRecord',
            //     url: 'Patient_MedicalRecord.html',
            //     bgColor: '#fff',
            //     pageParam: {
            //         F_ID: trId
            //     }
            // }, {
            // name: 'Patient_InformedConsent',
            // url: 'Patient_InformedConsent.html',
            // bgColor: '#fff',
            // pageParam: {
            //     F_ID: trId
            // }

            {
                name: 'Patient_ConditionRecord',
                url: 'Patient_ConditionRecord.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: trId
                }
            }, {//陪护
                name: 'accompany',
                url: 'accompany.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: trId,
                    userName: api.pageParam["userName"]
                }
            }]
        }, function (ret, err) {
            var index = ret.index;
            $api.removeCls($api.byId('a'), 'aui-active');
            $api.removeCls($api.byId('b'), 'aui-active');
            $api.removeCls($api.byId('c'), 'aui-active');
            // $api.removeCls($api.byId('d'), 'aui-active');
            $api.removeCls($api.byId('e'), 'aui-active');
            $api.removeCls($api.byId('g'), 'aui-active');
            $api.removeCls($api.byId('h'), 'aui-active');
            $api.removeCls($api.byId('i'), 'aui-active');
            if (index == 0) {
                $api.addCls($api.byId('a'), 'aui-active');
            } else if (index == 1) {
                $api.addCls($api.byId('b'), 'aui-active');
            } else if (index == 2) {
                $api.addCls($api.byId('c'), 'aui-active');
            }
            else if (index == 3) {
                $api.addCls($api.byId('e'), 'aui-active');
            }
            else if (index == 4) {
                $api.addCls($api.byId('g'), 'aui-active');
            } else if (index == 5) {
                $api.addCls($api.byId('h'), 'aui-active');
            } else if (index == 6) {
                $api.addCls($api.byId('i'), 'aui-active');
            }
        });
    };
    var tab = new auiTab({
        element: document.getElementById("tab"),
    }, function (ret) {
        api.setFrameGroupIndex({
            name: 'siji',
            index: ret.index - 1
        });
    });

    function goback() {
        api.closeWin({});
    }
</script>

</html>